Skip to main content
Glama

Algorand MCP

by GoPlausible
{ "openapi": "3.0.0", "paths": { "/wallet/signin/message": { "post": { "operationId": "WalletController_createSigninMessage", "summary": "Generate message from the sign in data", "description": "Returns the message that should be signed by user wallet\n#### Technology types:\n* `ALGORAND`\n* `EVM`\n* `SOLANA`\n", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostSignInMessageDto" } } } }, "responses": { "201": { "description": "Generated message in hex", "content": { "application/json": { "schema": { "example": { "message": "4279207369676e696e672074686973206d65737361676520796f7520617265206c6f6767696e6720696e746f20796f75722074726164696e67206163636f756e740a" } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Wallet" ] } }, "/wallet/signin": { "put": { "operationId": "WalletController_signin", "summary": "Sign in to trading account", "description": "Returns the session token that is used in the X-Wallet-Token header\n### Instructions for Creating an SignIn Message\n\nTo create a message, follow these steps:\n\n1. *Create JSON string from data or use any custom string*\n2. *Convert string to bytes*\n3. *Convert bytes to hex string*\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n#### Example of Message Creation\n```\ntypescript\nconst signingMessage = \"By signing this message you are logging into your trading account\";\nconst message = Buffer.from(Buffer.from(signingMessage, 'utf-8')).toString(\"hex\");\n```\n\n\n#### Technology types:\n* `ALGORAND`\n* `EVM`\n* `SOLANA`\n\n", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostSignInDto" } } } }, "responses": { "201": { "description": "Login session token", "content": { "application/json": { "schema": { "example": "40a04d7b-86f2-4e9a-a4aa-e12efe4da949" } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/keys": { "get": { "operationId": "WalletController_", "summary": "Get trading keys", "description": "\nFetch the list of trading keys related to the login wallet address\n\nThe `orders` field in the response indicates the number of orders created by the trading key\n\n\n#### Trading key types:\n* `User`\n* `API`\n\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Trading keys retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "address": "YPORHVPTRCT5AMO647P5LCYVXCV5TIW6YVYL36IQLX7BGLMFXKHV2SZNPE", "device": "Firefox 125.0 Gecko Linux, desktop", "type": "User", "createdAt": "2024-06-26T08:34:01.047Z", "expiredAt": "2024-07-26T08:33:58.000Z", "orders": 0 } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/key": { "post": { "operationId": "WalletController_", "summary": "Add trading key", "description": "Returns the address of trading key as part of the result that is used in the X-Trading-Key header\n### Instructions for Creating a TK Message\n\nTo create a message from multiple arguments, follow these steps:\n\n**Concatenate all arguments in their bytes representation in a specific order.** Each argument must have a specific length.\n\n#### Example of Message Creation\n\n```typescript\nconst tkBytes = concatBytes([\n tradingKeyAddress, // normalized algorand account address 32 bytes\n liginAccountAddress, // normalized wallet address 32 bytes\n loginChainId, // chain id (Wormhole chain id) 8 bytes\n expirationTime, // expiration time 8 bytes\n]);\n\nconst bs64TKBytes = new ByteArray(tkBytes.toBase64());\n```\n\n### Normalizing Addresses\n\nThe normalized address is a 32-byte hex string converted from the original address. This normalization ensures that addresses from different chains are of a consistent length for codex management and WH message interaction.\n\n#### Examples of Normalized Addresses:\n\n- **EVM Address**:\n - Original: `0xC8b9Cb9D80e8d35486A2bf9e9F8DF793c2d077a0`\n - Normalized: `00000000000000000000000c8b9cb9d80e8d35486a2bf9e9f8df793c2d077a0`\n\n- **Algorand Address**:\n - Original: `EN24BSP6WLG2DI7WOZ45P4A2PHI5RKCGA4ZE4W3C6E3GCWBPOUU4ZCX4D4`\n ```typescript\n algosdk.decodeAddress(address).publicKey\n ```\n - Normalized: `2375c0c9feb2cda1a3f67679d7f01a79d1d8a84607324e5b62f13661582f7529`\n\n- **Solana Address**:\n - Original: `D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW`\n ```typescript\n bs58.decode(address)\n ```\n - Normalized: `b3cafe5d05e60d7452fab7b6300f8b0f16842fa76b1168765bcbd9bbc652003d`\n\n- **Algorand Token ID**:\n - Original: `10458941`\n - Normalized: `0000000000000000000000000000000000000000000000000000000010458941`\n\n**Important Note:** The `tkBytes` must be converted to a base64 string and then the base64 string must be converted back to bytes.\n\n#### Final Step: Convert Final Bytes Result into a Hex String\n\n```typescript\nconst hexTKBytes = Buffer.from(bs64TKBytes).toString('hex');\n```\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n#### Trading key types:\n* `User`\n* `API`\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Trading key added successfully", "content": { "application/json": { "schema": { "example": { "address": "YPORHVPTRCT5AMO647P5LCYVXCV5TIW6YVYL36IQLX7BGLMFXKHV2SZNPE", "type": "User", "device": "Firefox 125.0 Gecko Linux, desktop", "createdAt": "2024-06-26T08:34:01.047Z", "expiredAt": "2024-07-26T08:33:57.662Z", "orders": 0 } } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] }, "delete": { "operationId": "WalletController_", "summary": "Revoke trading key", "description": "\n### Instructions for Creating a TK Message\n\nTo create a message from multiple arguments, follow these steps:\n\n**Concatenate all arguments in their bytes representation in a specific order.** Each argument must have a specific length.\n\n#### Example of Message Creation\n\n```typescript\nconst tkBytes = concatBytes([\n tradingKeyAddress, // normalized algorand account address 32 bytes\n liginAccountAddress, // normalized wallet address 32 bytes\n loginChainId, // chain id (Wormhole chain id) 8 bytes\n expirationTime, // expiration time 8 bytes\n]);\n\nconst bs64TKBytes = new ByteArray(tkBytes.toBase64());\n```\n\n### Normalizing Addresses\n\nThe normalized address is a 32-byte hex string converted from the original address. This normalization ensures that addresses from different chains are of a consistent length for codex management and WH message interaction.\n\n#### Examples of Normalized Addresses:\n\n- **EVM Address**:\n - Original: `0xC8b9Cb9D80e8d35486A2bf9e9F8DF793c2d077a0`\n - Normalized: `00000000000000000000000c8b9cb9d80e8d35486a2bf9e9f8df793c2d077a0`\n\n- **Algorand Address**:\n - Original: `EN24BSP6WLG2DI7WOZ45P4A2PHI5RKCGA4ZE4W3C6E3GCWBPOUU4ZCX4D4`\n ```typescript\n algosdk.decodeAddress(address).publicKey\n ```\n - Normalized: `2375c0c9feb2cda1a3f67679d7f01a79d1d8a84607324e5b62f13661582f7529`\n\n- **Solana Address**:\n - Original: `D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW`\n ```typescript\n bs58.decode(address)\n ```\n - Normalized: `b3cafe5d05e60d7452fab7b6300f8b0f16842fa76b1168765bcbd9bbc652003d`\n\n- **Algorand Token ID**:\n - Original: `10458941`\n - Normalized: `0000000000000000000000000000000000000000000000000000000010458941`\n\n**Important Note:** The `tkBytes` must be converted to a base64 string and then the base64 string must be converted back to bytes.\n\n#### Final Step: Convert Final Bytes Result into a Hex String\n\n```typescript\nconst hexTKBytes = Buffer.from(bs64TKBytes).toString('hex');\n```\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n#### Trading key types:\n* `User`\n* `API`\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Trading key revoked successfully" }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/key/message": { "post": { "operationId": "WalletController_createTradingKeyMessage", "summary": "Generate message from the trading key data", "description": "The trading key simplifies the trading process and is used to shadow sign a message. Trading key can only be used to sign a message from requests POST/DELETE market/order.", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostTradingKeyMessageDto" } } } }, "responses": { "201": { "description": "Generated message in hex", "content": { "application/json": { "schema": { "example": { "message": "4279207369676e696e672074686973206d65737361676520796f7520617265206c6f6767696e6720696e746f20796f75722074726164696e67206163636f756e740a" } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Wallet" ] } }, "/wallet/trades": { "get": { "operationId": "WalletController_", "summary": "Get filtered wallet trades", "description": "Provide either the x-wallet-token or x-trading-key header. If x-wallet-token is provided, x-trading-key is not required, and vice versa.\n\n **Note:** The response is limited to a maximum of **500** records.\n ", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Filtered wallet trades retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "tradeId": 712, "orderId": 13, "orderSide": "B", "pairId": 14, "baseTokenId": 9, "baseTokenDecimal": 6, "quoteTokenId": 8, "quoteTokenDecimal": 6, "status": "CONFIRMED", "amount": "350000000", "price": "10000", "fee": "805000", "createdAt": "2024-08-05T09:59:20.507Z", "updatedAt": "2024-08-05T09:59:20.000Z", "isBuyer": true, "isMaker": false } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/transactions": { "get": { "operationId": "WalletController_", "summary": "Get filtered wallet transactions", "description": "Provide either the x-wallet-token or x-trading-key header. If x-wallet-token is provided, x-trading-key is not required, and vice versa.\n\n#### Wallet transaction statuses:\n* `pending`\n* `completed`\n* `failed`\n* `received`\n\n#### Wallet transaction types:\n* `deposit`\n* `withdraw`\n\n **Note:** The response is limited to a maximum of **500** records.\n ", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Filtered wallet transactions retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "primaryId": 195, "id": "bf9484bebe4f30cbff9c1a5a59ed4b4946c149cb581b90ee0496bdef7b6f7828", "login_address": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "login_chain_id": 1, "action_type": "deposit", "status": "completed", "amount": "1000000", "targetAddress": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "timestamp": "2023-12-19T08:33:06.000Z", "createdAt": "2023-12-19T08:33:06.576Z", "updatedAt": "2023-12-19T08:33:06.576Z", "vaa_message": null, "fee": "100", "token_id": { "id": 12, "address": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "chainId": 1, "unitName": "USDCs", "name": "", "decimals": 6, "isGas": false, "deletedAt": null }, "transactions": { "txnHash": "FWKC6RRNQ5LOODCBX4AME5HWNCLJCYA2NU3VAMFOX3LVCFZPNDIA", "chainId": 8 } }, { "primaryId": 432, "id": "ef117bad310c4ca6e086b1ef7d8dc8fe9191630bbce8e5806f2c6b24d32a17d5", "login_address": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "login_chain_id": 1, "action_type": "deposit", "status": "completed", "amount": "5000000", "targetAddress": "B9a4FpxhTzfv2eCCYBiDdrrYfB23HGRNp3bf38vb1UFP", "timestamp": "2024-02-02T12:11:01.000Z", "createdAt": "2024-02-02T12:11:01.363Z", "updatedAt": "2024-02-02T12:11:07.000Z", "vaa_message": { "type": "Buffer", "data": [ 1, 0, 0, 0, 0, 1, 0, 187, 94, 152, 40, 10, 65, 193, 165, 163, 32, 162, 107, 114, 224, 159, 76, 119, 184, 155, 80, 133, 38, 61, 113, 141, 151, 140, 55, 83, 93, 61, 29, 96, 34, 196, 34, 28, 167, 126, 114, 188, 212, 145, 246, 55, 183, 167, 142, 182, 202, 17, 224, 191, 253, 110, 96, 51, 101, 16, 30, 255, 70, 15, 143, 1, 101, 188, 219, 211, 0, 0, 0, 0, 0, 1, 150, 198, 228, 117, 219, 78, 178, 49, 13, 23, 82, 23, 145, 30, 29, 75, 2, 121, 63, 94, 12, 7, 55, 239, 82, 114, 172, 211, 140, 179, 167, 14, 0, 0, 0, 0, 0, 0, 0, 168, 1, 100, 101, 112, 111, 115, 105, 116, 248, 149, 228, 62, 63, 147, 164, 23, 189, 159, 139, 75, 87, 156, 105, 3, 54, 78, 245, 116, 17, 43, 78, 197, 7, 45, 86, 46, 130, 153, 58, 91, 233, 40, 57, 85, 9, 101, 255, 212, 214, 74, 202, 175, 70, 212, 93, 247, 49, 142, 91, 79, 87, 201, 12, 72, 125, 96, 98, 93, 130, 155, 131, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 75, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 248, 149, 228, 62, 63, 147, 164, 23, 189, 159, 139, 75, 87, 156, 105, 3, 54, 78, 245, 116, 17, 43, 78, 197, 7, 45, 86, 46, 130, 153, 58, 91 ] }, "token_id": { "id": 12, "address": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "chainId": 1, "unitName": "USDCs", "name": "", "decimals": 6, "isGas": false, "deletedAt": null } } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/withdraw": { "post": { "operationId": "WalletController_", "summary": "Withdraw token", "description": "Initiate request to withdraw funds based on data encoded in the signed message\n### Instructions for Creating a Withdrawal Message\n\nTo create a message from multiple arguments, follow these steps:\n\n**Concatenate all arguments in their bytes representation in a specific order.** Each argument must have a specific length.\n\n#### Example of Message Creation\n\n```typescript\nconst withdrawBytes = concatBytes([\n liginAccountAddress, // normalized wallet address 32 bytes\n loginAccountChainId, // chain id (Wormhole chain id) 8 bytes\n tokenAddress, // normalized token address taken from market pair 32 bytes\n tokenChainId, // base token Wormhole chain id 8 bytes\n recipientAddress, // normalized recipient address 32 bytes\n recipientChainId, // chain id (Wormhole chain id) 8 bytes\n amount, // amount in atomic units 32 bytes\n isNative, // is token native 1 byte\n fee, // fee amount 32 bytes\n]);\n\nconst bs64WithdrawBytes = new ByteArray(withdrawBytes.toBase64());\n```\n\n### Normalizing Addresses\n\nThe normalized address is a 32-byte hex string converted from the original address. This normalization ensures that addresses from different chains are of a consistent length for codex management and WH message interaction.\n\n#### Examples of Normalized Addresses:\n\n- **EVM Address**:\n - Original: `0xC8b9Cb9D80e8d35486A2bf9e9F8DF793c2d077a0`\n - Normalized: `00000000000000000000000c8b9cb9d80e8d35486a2bf9e9f8df793c2d077a0`\n\n- **Algorand Address**:\n - Original: `EN24BSP6WLG2DI7WOZ45P4A2PHI5RKCGA4ZE4W3C6E3GCWBPOUU4ZCX4D4`\n ```typescript\n algosdk.decodeAddress(address).publicKey\n ```\n - Normalized: `2375c0c9feb2cda1a3f67679d7f01a79d1d8a84607324e5b62f13661582f7529`\n\n- **Solana Address**:\n - Original: `D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW`\n ```typescript\n bs58.decode(address)\n ```\n - Normalized: `b3cafe5d05e60d7452fab7b6300f8b0f16842fa76b1168765bcbd9bbc652003d`\n\n- **Algorand Token ID**:\n - Original: `10458941`\n - Normalized: `0000000000000000000000000000000000000000000000000000000010458941`\n\n**Important Note:** The `withdrawBytes` must be converted to a base64 string and then the base64 string must be converted back to bytes.\n\n#### Final Step: Convert Final Bytes Result into a Hex String\n\n```typescript\nconst hexWithdrawBytes = Buffer.from(bs64WithdrawBytes).toString('hex');\n```\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Withdrawal successful" }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Wallet" ] } }, "/wallet/withdraw/message": { "post": { "operationId": "WalletController_createWithdrawMessage", "summary": "Generate message from the withdrawal data", "description": "Returns the message that should be signed by user wallet", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostWithdrawMessageDto" } } } }, "responses": { "201": { "description": "Generated message in hex", "content": { "application/json": { "schema": { "example": { "message": "4279207369676e696e672074686973206d65737361676520796f7520617265206c6f6767696e6720696e746f20796f75722074726164696e67206163636f756e740a" } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Wallet" ] } }, "/market/price": { "get": { "operationId": "MarketController_getPrice", "summary": "Get last market price by pair symbol", "description": "The response contains the `ts` field in the following format: `{TIMESTAMP_WITH_MS}`.`{MICROSECONDS}`", "parameters": [ { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Price retrieved successfully", "schema": { "example": { "pairId": 46, "pair": "usdcs_algo", "askPrice": "35000", "askQty": "64000000", "bidPrice": "29910", "bidQty": "247000000", "lastPrice": "31230", "ts": 1719323536855.245, "u": 4065, "U": 4021 } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPriceResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/depth": { "get": { "operationId": "MarketController_getDepth", "summary": "Get order book depth", "description": "\nThe `buy` and `sell` fields in the response have the following structure: `[ [price, amount] ]`\n\nThe response contains the `ts` field in the following format: `{TIMESTAMP_WITH_MS}`.`{MICROSECONDS}`\n\n **Note:** The response is limited to a maximum of **100** records.\n ", "parameters": [ { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": { "type": "string" } }, { "name": "depth", "required": true, "in": "query", "description": "If depth > 100, then the response will truncate to 100", "example": 100, "schema": { "type": "number" } } ], "responses": { "200": { "description": "Order book depth retrieved successfully", "schema": { "example": { "pair": "usdcs_algo", "buy": [ [ "1000", "1000000" ] ], "sell": [ [ "7000", "1000000" ] ], "ts": 1719323536855.245, "u": 4065 } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDepthResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/last-trades": { "get": { "operationId": "MarketController_getLastTrades", "summary": "Get last trades", "description": "\nThe response contains the `createdAt` field in the following format: `{TIMESTAMP_WITH_MS}`.`{MICROSECONDS}`\n\n **Note:** The response is limited to a maximum of **100** records.\n ", "parameters": [ { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": { "type": "string" } }, { "name": "limit", "required": false, "in": "query", "description": "Amount of trades. If limit > 100, then the response will truncate to 100", "schema": { "maximum": 100, "default": 100, "type": "number" } } ], "responses": { "200": { "description": "Last trades retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "tradeId": 1, "price": "6000", "amount": "1000000", "total": "6000", "createdAt": 1719318832371.647, "isBuyerMaker": false }, { "tradeId": 2, "price": "1000", "amount": "1500000", "total": "1500", "createdAt": 1719302531935.491, "isBuyerMaker": false } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/symbols": { "get": { "operationId": "MarketController_getSymbols", "summary": "Get market symbols", "parameters": [], "responses": { "200": { "description": "Market symbols retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "pairKey": "algo_usdcs" }, { "pairKey": "algo_usdc" }, { "pairKey": "yldy_stbl" }, { "pairKey": "lmbo_usdcs" }, { "pairKey": "moon_algo" } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/history": { "get": { "operationId": "MarketController_getHistory", "summary": "Get market history", "description": "\nResolution interval values clarification\n\n| Resolution | Format | Example |\n| ---------- | ------------------------ | -------- |\n| Minutes | `x` | 1, 3, 5, 15, 30, 59, 115 |\n| Hours | `xH` or `x` minutes | 1h, 2H, 240 (minutes) - four hours |\n| 24H | `24H` | from the end time to the end time - 24h |\n| Days | `xD`or `xH` hours | 1D - one day, 5D - five days |\n| Weeks | `xW`or `xD` days | 1W - one week, 4W - four weeks |\n| Months | `xM` | 1M - one month, 6M - six months |\n| Years | `xY`or `xM` months | 12M - one year, 24M - two years, 1Y - one year |\n\n### Notes:\n* Intervals are case insensitive\n* Interval `60` (minutes) means 1 hour\n* Interval `1440` (minutes) means 1 day\n* Interval `24h` (hours) means 24 hours, not 1 calendar day\n* Interval `48h` (hours) means 2 calendar days\n* Interval `10080` (minutes) means 1 week\n* Interval `168H` (hours) means 1 week\n* Interval `7d` (days) means 1 week\n* Interval `12m` (months) means 1 year\n\n### Current version doesn't support intervals `ticks` and `seconds`\n", "parameters": [ { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": { "type": "string" } }, { "name": "interval", "required": true, "in": "query", "description": "Resolution interval", "example": "60", "schema": { "type": "string" } }, { "name": "startTime", "required": true, "in": "query", "description": "UTC timestamp in seconds", "example": 1718776962, "schema": { "type": "number" } }, { "name": "endTime", "required": true, "in": "query", "description": "UTC timestamp in seconds", "example": 1718875662, "schema": { "type": "number" } }, { "name": "limit", "required": false, "in": "query", "description": "Max amount of candles", "example": 100, "schema": { "type": "number" } }, { "name": "format", "required": false, "in": "query", "description": "Response format", "schema": { "default": "object", "enum": [ "object", "array" ], "type": "string" } } ], "responses": { "200": { "description": "Market history retrieved successfully", "schema": { "example": { "t": [ 1702944000, 1705968000, 1707177600, 1708473600, 1709596800, 1710201600, 1710288000, 1710374400, 1716249600, 1716336000, 1716422400, 1716508800, 1719273600 ], "o": [ 0.001, 0.001, 0.05, 0.001, 0.044, 0.046, 0.048, 0.049, 0.001, 1, 0.01, 0.019, 0.001 ], "h": [ 0.001, 0.17, 0.05, 0.002, 0.045, 0.046, 0.048, 0.049, 0.001, 1, 1, 0.019, 0.2 ], "c": [ 0.001, 0.013, 0.05, 0.001, 0.045, 0.046, 0.048, 0.049, 0.001, 1, 1, 0.001, 0.006 ], "l": [ 0.001, 0.001, 0.05, 0.001, 0.044, 0.046, 0.048, 0.049, 0.001, 1, 0.001, 0.001, 0.001 ], "v": [ 1, 28.5, 1, 3.8, 2, 1, 1, 2, 1, 3, 12, 19, 4 ], "q": [ 1, 28.5, 1, 3.8, 2, 1, 1, 2, 1, 3, 12, 19, 4 ], "s": "ok", "b": 1702989335082 } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetHistoryResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/orders-with-trades": { "get": { "operationId": "MarketController_", "summary": "Get orders with trades", "description": "Provide either the x-wallet-token or x-trading-key header. If x-wallet-token is provided, x-trading-key is not required, and vice versa.\n#### Order statuses:\n* `1` - Open\n* `2` - Canceled\n* `3` - Matched\n* `4` - Self-matched\n* `5` - Expired\n \n#### Order types:\n* `0` - LIMIT\n* `1` - IOC\n* `2` - POST\n* `3` - MARKET\n \n#### Order sides:\n* `0` - BUY\n* `1` - SELL\n \n **Note:** The response is limited to a maximum of **100** records.\n ", "parameters": [ { "name": "address", "required": true, "in": "query", "description": "Wallet address", "examples": { "algorand": { "value": "EEEMLFBSGYBPNMSIVHLTKIKUSLP2VTF4EN65Y66JXPEVPLU3OUNNKMCWXI", "description": "Algorand public key" }, "evm": { "value": "0x3b6845fb389771dBC794E76BBF3E51783a437886", "description": "EVM public key" }, "solana": { "value": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "description": "Solana public key" } }, "schema": {} }, { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": {} }, { "name": "status", "required": true, "in": "query", "description": "Order status", "examples": { "open": { "value": 1, "description": "Open orders" }, "closed": { "value": 2, "description": "Closed orders" } }, "schema": {} }, { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Orders with trades retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "id": 110048, "pair_id": 56, "order_side": 1, "order_type": 0, "direct_settle": 0, "order_price": "5000", "order_executed_price": "5000", "order_amount": "1000000", "order_filled_amount": "200000", "order_total": "0", "order_filled_total": "0", "order_status": 1, "trades_id": null, "trade_price": null, "trade_amount": null, "trade_fee": null, "trade_rebate": null, "trade_total": null, "trade_created_at": null, "user_id": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "completed_at": null, "created_at": "2024-06-25T14:13:05.252Z", "updated_at": "2024-06-25T14:13:09.000Z" }, { "id": 110048, "pair_id": 56, "order_side": 1, "order_type": 0, "direct_settle": 0, "order_price": "5000", "order_executed_price": "5000", "order_amount": "1000000", "order_filled_amount": "200000", "order_total": "0", "order_filled_total": "0", "order_status": 1, "trades_id": 453545, "trade_price": "5000", "trade_amount": "200000", "trade_fee": 2, "trade_rebate": 0, "trade_total": "1000", "trade_created_at": "2024-06-25T14:13:05.278Z", "user_id": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "completed_at": null, "created_at": "2024-06-25T14:13:05.252Z", "updated_at": "2024-06-25T14:13:09.000Z" } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Market" ] } }, "/market/wallet-transactions": { "get": { "operationId": "MarketController_", "summary": "Get account transactions. Use a new endpoint GET /wallet/transactions", "deprecated": true, "description": "Provide either the x-wallet-token or x-trading-key header. If x-wallet-token is provided, x-trading-key is not required, and vice versa.", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Account transactions retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "primaryId": 195, "id": "bf9484bebe4f30cbff9c1a5a59ed4b4946c149cb581b90ee0496bdef7b6f7828", "login_address": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "login_chain_id": 1, "action_type": "deposit", "status": "completed", "amount": "1000000", "targetAddress": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "timestamp": "2023-12-19T08:33:06.000Z", "createdAt": "2023-12-19T08:33:06.576Z", "updatedAt": "2023-12-19T08:33:06.576Z", "vaa_message": null, "token_id": { "id": 12, "address": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "chainId": 1, "unitName": "USDCs", "name": "", "decimals": 6, "isGas": false, "deletedAt": null } }, { "primaryId": 432, "id": "ef117bad310c4ca6e086b1ef7d8dc8fe9191630bbce8e5806f2c6b24d32a17d5", "login_address": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "login_chain_id": 1, "action_type": "deposit", "status": "completed", "amount": "5000000", "targetAddress": "B9a4FpxhTzfv2eCCYBiDdrrYfB23HGRNp3bf38vb1UFP", "timestamp": "2024-02-02T12:11:01.000Z", "createdAt": "2024-02-02T12:11:01.363Z", "updatedAt": "2024-02-02T12:11:07.000Z", "vaa_message": { "type": "Buffer", "data": [ 1, 0, 0, 0, 0, 1, 0, 187, 94, 152, 40, 10, 65, 193, 165, 163, 32, 162, 107, 114, 224, 159, 76, 119, 184, 155, 80, 133, 38, 61, 113, 141, 151, 140, 55, 83, 93, 61, 29, 96, 34, 196, 34, 28, 167, 126, 114, 188, 212, 145, 246, 55, 183, 167, 142, 182, 202, 17, 224, 191, 253, 110, 96, 51, 101, 16, 30, 255, 70, 15, 143, 1, 101, 188, 219, 211, 0, 0, 0, 0, 0, 1, 150, 198, 228, 117, 219, 78, 178, 49, 13, 23, 82, 23, 145, 30, 29, 75, 2, 121, 63, 94, 12, 7, 55, 239, 82, 114, 172, 211, 140, 179, 167, 14, 0, 0, 0, 0, 0, 0, 0, 168, 1, 100, 101, 112, 111, 115, 105, 116, 248, 149, 228, 62, 63, 147, 164, 23, 189, 159, 139, 75, 87, 156, 105, 3, 54, 78, 245, 116, 17, 43, 78, 197, 7, 45, 86, 46, 130, 153, 58, 91, 233, 40, 57, 85, 9, 101, 255, 212, 214, 74, 202, 175, 70, 212, 93, 247, 49, 142, 91, 79, 87, 201, 12, 72, 125, 96, 98, 93, 130, 155, 131, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 75, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 248, 149, 228, 62, 63, 147, 164, 23, 189, 159, 139, 75, 87, 156, 105, 3, 54, 78, 245, 116, 17, 43, 78, 197, 7, 45, 86, 46, 130, 153, 58, 91 ] }, "token_id": { "id": 12, "address": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "chainId": 1, "unitName": "USDCs", "name": "", "decimals": 6, "isGas": false, "deletedAt": null } } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" } }, "tags": [ "Market" ] } }, "/market/markets": { "get": { "operationId": "MarketController_getMarkets", "summary": "Get markets", "parameters": [ { "name": "companyId", "required": true, "in": "query", "description": "Id of the company", "example": 28, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Markets retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "base_chain_id": 8, "base_currency": "algo", "base_decimal": 6, "base_id": "0", "created_at": "2024-06-17T10:46:14.550Z", "id": 12, "is_active": true, "min_order_size": "1000000", "min_price_increment": "100", "min_size_increment": "1000000", "pair_key": "algo_usdcs", "pair_name": "ALGO_USDCs", "pairId": 12, "price_chain_id": 1, "price_currency": "usdcs", "price_decimal": 6, "price_id": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "updated_at": "2024-06-17T10:46:14.550Z", "inuseWithPartners": [ 1 ], "restrictedCountries": [], "pairSettings": {} }, { "base_chain_id": 8, "base_currency": "algo", "base_decimal": 6, "base_id": "0", "created_at": "2024-06-17T10:46:14.551Z", "id": 13, "is_active": true, "min_order_size": "1000000", "min_price_increment": "100", "min_size_increment": "1000000", "pair_key": "algo_usdc", "pair_name": "ALGO_USDC", "pairId": 13, "price_chain_id": 8, "price_currency": "usdc", "price_decimal": 6, "price_id": "157824770", "updated_at": "2024-06-17T10:46:14.551Z", "inuseWithPartners": [ 1 ], "restrictedCountries": [ "US" ], "pairSettings": { "mft.audioLink": "", "view.baseCoinIconLink": "", "mft.title": "" } } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/market": { "get": { "operationId": "MarketController_getMarket", "summary": "Get market details", "parameters": [ { "name": "symbol", "required": true, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Market details retrieved successfully", "content": { "application/json": { "schema": { "example": { "id": 56, "pairId": 56, "pair_key": "usdcs_algo", "is_active": true, "base_chain_id": 1, "base_currency": "usdcs", "base_decimal": 6, "base_id": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "price_chain_id": 8, "price_currency": "algo", "price_decimal": 6, "price_id": "0", "pair_name": "USDCS_ALGO", "min_price_increment": "1000", "min_order_size": "1000000", "min_size_increment": "100000", "created_at": "2023-12-18T18:45:36.906Z", "updated_at": "2024-03-14T15:30:24.019Z" } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/settings": { "get": { "operationId": "MarketController_getSettings", "summary": "Get market settings", "parameters": [ { "name": "wl-domain", "required": true, "in": "header", "description": "Domain of the dApp", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Settings retrieved successfully", "content": { "application/json": { "schema": { "example": { "company.enabled": "1", "partnerId": 201273942, "company.appTitle": "ULTRADE", "company.domain": "ultradedev.net", "product.amm": "false", "product.obdex": "true", "appearance.logo": "{\"theme1\":{\"value\":\"https://dev.ultradedev.net/Theme%3DDark.svg\",\"active\":true},\"theme2\":{\"value\":\"./Theme%3DLight.svg\",\"active\":true},\"theme3\":{\"value\":\"./Theme%3DLight.svg\",\"active\":true}}", "appearance.themes": "{\"theme1\":{\"name\":\"dark\",\"active\":true,\"value\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(1, 1, 1, 1)\",\"primary-text\":\"rgba(255, 255, 255, 1)\",\"module-background\":\"rgba(19, 23, 34, 1)\",\"buy-text\":\"rgba(82, 164, 154, 1)\",\"buy-background\":\"rgba(2, 199, 122, 0.25)\",\"sell-text\":\"rgba(221, 94, 86, 1)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"input-background-default\":\"rgba(13, 15, 21, 1)\",\"input-background-hover\":\"rgba(28, 33, 45, 1)\",\"input-background-disabled\":\"rgba(25, 29, 41, 1)\",\"input-border-default\":\"rgba(28, 33, 45, 1)\",\"module-border\":\"rgba(28, 33, 45, 1)\",\"button-disabled\":\"rgba(111, 113, 118, 1)\",\"button-border\":\"rgba(255, 255, 255, 1)\",\"input-border-active\":\"rgba(185, 163, 238, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgba(28, 33, 45, 1)\"}},\"theme2\":{\"name\":\"light\",\"active\":true,\"value\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(249, 248, 248, 1)\",\"primary-text\":\"rgba(0, 0, 0, 1)\",\"module-background\":\"rgba(255, 255, 255, 1)\",\"buy-text\":\"rgba(0, 112, 98, 1)\",\"buy-background\":\"rgba(0, 112, 98, 0.25)\",\"sell-text\":\"rgba(195, 12, 1, 1)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"button-disabled\":\"rgba(203, 199, 199, 1)\",\"input-background-default\":\"rgba(255, 255, 255, 1)\",\"input-background-hover\":\"rgba(249, 248, 248, 1)\",\"input-background-disabled\":\"rgba(249, 248, 248, 1)\",\"input-border-default\":\"rgba(228, 225, 225, 1)\",\"module-border\":\"rgba(228, 225, 225, 1)\",\"button-border\":\"rgba(170, 167, 167, 1)\",\"input-border-active\":\"rgba(0, 0, 0, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgb(249, 248, 248)\"}},\"theme3\":{\"name\":\"purple\",\"active\":true,\"value\":{\"primary-1\":\"rgba(118, 63, 229, 1)\",\"primary-2\":\"rgba(249, 132, 146, 1)\",\"main-background\":\"rgba(255, 255, 255, 1)\",\"primary-text\":\"rgba(0, 0, 0, 1)\",\"secondary-text\":\"rgba(127, 127, 127, 1)\",\"buy-text\":\"rgba(0, 112, 98, 1)\",\"sell-text\":\"rgba(195, 12, 1, 1)\",\"buy-background\":\"rgba(0, 112, 98, 0.25)\",\"sell-background\":\"rgba(255, 59, 105, 0.25)\",\"module-background\":\"rgba(254, 250, 255, 1)\",\"module-border\":\"rgba(228, 225, 225, 1)\",\"input-background-default\":\"rgba(255, 255, 255, 1)\",\"input-background-hover\":\"rgba(249, 248, 248, 1)\",\"input-background-disabled\":\"rgba(254, 250, 255, 1)\",\"input-border-default\":\"rgba(228, 225, 225, 1)\",\"input-border-active\":\"rgba(0, 0, 0, 1)\",\"button-border\":\"rgba(170, 167, 167, 1)\",\"button-disabled\":\"rgba(203, 199, 199, 1)\",\"active-element-default\":\"rgba(230, 136, 150, 1)\",\"hover-element-default\":\"rgba(185, 163, 238, 1)\",\"dropdown-shadow\":\"rgba(154, 92, 253, 0.45)\",\"button-text\":\"rgba(255, 255, 255, 1)\",\"pair-active-row\":\"rgb(249, 248, 248)\"}}}", "company.geoblock": "[\"US\"]", "markets.pinnedPairs": "[45,47,48,49]", "company.minFee": "20", "company.makerFee": "200", "company.takerFee": "200", "company.feeShare": "90000", "company.directSettlement": "false", "company.ammFee": "10", "appearance.newTab": "true", "appearance.target": "https://dispenser.dev.ultradedev.net/123123", "appearance.reportButtons": "true", "currentCountry": "US", "isUltrade": true, "companyId": 1 } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/balances": { "get": { "operationId": "MarketController_", "summary": "Get account balances", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Balances retrieved successfully", "schema": { "example": [ { "hash": "fa97f507eb158752f28b0f95af10a7cc5ed9c257c2997acb1966993136e4be61", "loginAddress": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN", "loginChainId": 1, "tokenId": 1, "tokenAddess": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "tokenChainId": 1, "amount": "18800000", "lockedAmount": "800000" } ] }, "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BalanceResponseDto" } } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/assets": { "get": { "operationId": "MarketController_getAssets", "summary": "Get trading assets", "parameters": [], "responses": { "200": { "description": "Assets retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "id": 6, "address": "0", "chainId": 8, "name": "ALGO", "unitName": "ALGO", "decimals": 6, "isGas": false, "img": "https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1747037003", "cmcLink": "https://coinmarketcap.com/currencies/algorand/" }, { "id": 7, "address": "157824770", "chainId": 8, "name": "USDC", "unitName": "USDC", "decimals": 6, "isGas": false, "img": "https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1747037003", "cmcLink": "https://coinmarketcap.com/currencies/algorand/" } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/chains": { "get": { "operationId": "MarketController_getChains", "summary": "Get blockchain chains", "parameters": [ { "name": "includeDispenser", "required": false, "in": "query", "description": "Include dispenser", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Chains retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "chainId": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG", "name": "Solana Devnet", "whChainId": "1", "tmc": "2TzePtbeCgY6Y3QfZZdPkvUeTHQtostsKAU5Rr2CVyKh" }, { "chainId": "421614", "name": "Arbitrum Sepolia", "whChainId": "10003", "tmc": "0x760e519aB0489B6355F79AC617639DA46fB926e8" }, { "chainId": "11155420", "name": "Optimism Sepolia", "whChainId": "10005", "tmc": "0x64Dc3e823eBBF60D8782f5f118d3A3d9311B0917" }, { "chainId": "80002", "name": "Polygon Amoy", "whChainId": "10007", "tmc": "0x534d7Be28F3e7e46D756c878D4452f103C8cc168" } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/fee-rates": { "get": { "operationId": "MarketController_", "summary": "Get fee rates", "parameters": [], "responses": { "200": { "description": "Fee rates provided in basis points. 1 basis point = 0.01%", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetFeeRatesResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/wallet/fee-rates": { "get": { "operationId": "MarketController_", "summary": "Get fee rates", "parameters": [], "responses": { "200": { "description": "Fee rates provided in basis points. 1 basis point = 0.01%", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetFeeRatesResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/withdrawal-fee": { "get": { "operationId": "MarketController_", "summary": "Get withdrawal fee", "parameters": [], "responses": { "200": { "description": "Withdrawal fee retrieved successfully" }, "404": { "description": "Withdrawal fee not found" } }, "tags": [ "Market" ] } }, "/market/operation-details": { "get": { "operationId": "MarketController_", "parameters": [], "responses": { "200": { "description": "" } }, "tags": [ "Market" ] } }, "/market/order/{id}": { "get": { "operationId": "OrderController_", "summary": "Get order by ID", "description": "\n### Here the order result explanation\n\nFor BUY MARKET orders total is more than 0 and equals to the ```amount * price / 10 ^ base_decimal``` \n\nWhen the trade has both the amount and the price it's a regular trade. When the trade price has zero value it's a cancellation trade.\n\nTrade total is not 0 for cancellation trade of BUY MARKET order.\n \n#### Order statuses:\n* `1` - Open\n* `2` - Canceled\n* `3` - Matched\n* `4` - Self-matched\n* `5` - Expired\n \n#### Order types:\n* `0` - LIMIT\n* `1` - IOC\n* `2` - POST\n* `3` - MARKET\n \n#### Order sides:\n* `0` - BUY\n* `1` - SELL\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Order retrieved successfully", "schema": { "example": { "id": 2, "pairId": 13, "pair": "algo_usdc", "baseTokenId": 6, "baseTokenDecimal": 6, "quoteTokenId": 7, "quoteTokenDecimal": 6, "amount": "10000000", "price": "1000000000000000000", "total": "0", "filledAmount": "2000000", "filledTotal": "0", "avgPrice": "1000000000000000000", "status": 1, "side": 1, "type": 0, "userId": "0x37eAF916551B7DA897244E0f61120B81ad1B8636", "createdAt": 1719499926063, "updatedAt": 1719499926063, "completedAt": null, "trades": [ { "tradeId": 1, "tradeSide": 0, "amount": "1000000", "price": "1000000", "fee": "0", "createdAt": 1719499962401, "updatedAt": 1719499963000, "isBuyer": false, "isMaker": true }, { "tradeId": 2, "tradeSide": 0, "amount": "1000000", "price": "1000000", "fee": "1000", "createdAt": 1719499966665, "updatedAt": 1719499967000, "isBuyer": false, "isMaker": false } ] } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrderByIdResponseDto" } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/orders": { "get": { "operationId": "OrderController_", "summary": "Get orders", "description": "Get filtered orders related to the wallet address. \n#### Order statuses:\n* `1` - Open\n* `2` - Canceled\n* `3` - Matched\n* `4` - Self-matched\n* `5` - Expired\n \n#### Order types:\n* `0` - LIMIT\n* `1` - IOC\n* `2` - POST\n* `3` - MARKET\n \n#### Order sides:\n* `0` - BUY\n* `1` - SELL\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } }, { "name": "companyId", "in": "header", "description": "Optional header for filtering orders by company pairs", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Orders retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "id": 2, "pairId": 13, "pair": "algo_usdc", "amount": "10000000", "price": "1000000000000000000", "total": "0", "filledAmount": "2000000", "filledTotal": "0", "avgPrice": "1000000000000000000", "status": 1, "side": 1, "type": 0, "userId": "0x37eAF916551B7DA897244E0f61120B81ad1B8636", "createdAt": 1719499926063, "updatedAt": 1719499926063 } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] }, "post": { "operationId": "OrderController_", "summary": "Create new orders", "description": "\n\n### Order Message values explanation\n\nThe `random` value must be a number no more than 2 ^ 53 - 1\n\nThe `decimalPrice` is a price in decimal string value in the human readable format\n\nThe `price` is in factored units equals `decimalPrice` * 10 ^ 18\n\nThe `version` is a current order msg version. Current value: 1\n\n### Instructions for Creating an Order Creation Message\n\nTo create a message from multiple arguments, follow these steps:\n\n- Concatenate all arguments in their bytes representation in a specific order.\n- Each argument must have a specific length.\n\n#### Example of Message Creation\n\n```typescript\nconst orderBytes = concatBytes([\n version, // order msg version number 2 bytes\n expirationTime, // expiration time 4 bytes\n orderSide, // order side (\"B\" | \"S\") 1 byte\n price, // price in factored units 32 bytes\n amount, // amount in atomic units 32 bytes\n orderType, // order type (\"L\" | \"I\" | \"P\" | \"M\") 1 byte\n liginAccountAddress, // normalized wallet address 32 bytes\n loginAccountChainId, // chain id (Wormhole chain id) 2 bytes\n baseTokenAddress, // normalized token address 32 bytes\n baseTokenChainId, // base token Wormhole chain id 4 bytes\n priceTokenAddress, // normalized token address taken from market pair 32 bytes\n priceTokenChainId, // price token Wormhole chain id 4 bytes\n companyId, // company id 2 bytes\n randomValue, // random number 8 bytes\n decimalPrice, // human readable price decimal string 8 bytes\n zeroBytes // extra 50 zero bytes\n]);\n\nconst bs64OrderBytes = new ByteArray(orderBytes.toBase64());\n```\n\n### Normalizing Addresses\n\nThe normalized address is a 32-byte hex string converted from the original address. This normalization ensures that addresses from different chains are of a consistent length for codex management and WH message interaction.\n\n#### Examples of Normalized Addresses:\n\n- **EVM Address**:\n - Original: `0xC8b9Cb9D80e8d35486A2bf9e9F8DF793c2d077a0`\n - Normalized: `00000000000000000000000c8b9cb9d80e8d35486a2bf9e9f8df793c2d077a0`\n\n- **Algorand Address**:\n - Original: `EN24BSP6WLG2DI7WOZ45P4A2PHI5RKCGA4ZE4W3C6E3GCWBPOUU4ZCX4D4`\n ```typescript\n algosdk.decodeAddress(address).publicKey\n ```\n - Normalized: `2375c0c9feb2cda1a3f67679d7f01a79d1d8a84607324e5b62f13661582f7529`\n\n- **Solana Address**:\n - Original: `D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW`\n ```typescript\n bs58.decode(address)\n ```\n - Normalized: `b3cafe5d05e60d7452fab7b6300f8b0f16842fa76b1168765bcbd9bbc652003d`\n\n- **Algorand Token ID**:\n - Original: `10458941`\n - Normalized: `0000000000000000000000000000000000000000000000000000000010458941`\n\nBy following these instructions and using the provided example, you can concatenate multiple arguments into a byte array and normalize addresses for consistent handling across different blockchain networks.\n\n**Important Note:** The `orderBytes` must be converted to a base64 string and then the base64 string must be converted back to bytes.\n\n#### Final Step: Convert Final Bytes Result into a Hex String\n\n```typescript\nconst hexOrderBytes = Buffer.from(bs64OrderBytes).toString('hex');\n```\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n### Market Order Rules\n\nWhen creating Market Orders, the interpretation of amount and price (which represents the total in this context) depends on the type of market order and whether the order is a buy or sell order.\n#### BUY MARKET ORDER\n\n**By Amount**:\namount is not zero,\n price (total) is not zero and represents the maximum volume of the quote currency (price coin) you are willing to spend.\n The system calculates the total amount you will receive based on the current market prices.\n\n**By Total**:\namount is zero,\n price (total) is not zero and represents the maximum volume of the quote currency (price coin) you are willing to spend.\n The system calculates the amount of the base currency (amount coin) you will receive for the specified total.\n\n#### SELL MARKET ORDER\n\nBy Amount:\n amount is not zero and represents the quantity of the base currency (amount coin) you want to sell.\n price (total) is zero because in a sell market order, the system will automatically determine the total amount of the quote currency (price coin) you will receive based on current market prices.\n\n#### Summary of Logic:\n\nIn Buy Market Orders, the price field represents the maximum total in quote currency you are willing to spend, and it must be provided.\nIn Sell Market Orders, the amount field represents the quantity you wish to sell, and the system calculates the corresponding total based on the market.\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Order created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrdersDto" } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" }, "500": { "description": "Internal server error" } }, "tags": [ "Market" ] }, "delete": { "operationId": "OrderController_", "summary": "Cancel multiple open orders", "description": "\n### Instructions for Creating an Order Cancellation Message\n\nTo create a message from data, follow these steps:\n\n1. *Create JSON string from data*\n2. *Convert JSON string to bytes*\n3. *Convert bytes to hex string*\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n\n#### Example of Message Creation\n```\ntypescript\nconst data1 = { \"orderIds\": [1, 8, 16] };\nconst jsonData1 = JSON.stringify(data1);\nconst message1 = Buffer.from(Buffer.from(jsonData1, 'utf-8')).toString(\"hex\");\n\nconst data2 = { \"pairId\": 5 };\nconst jsonData2 = JSON.stringify(data2);\nconst message2 = Buffer.from(Buffer.from(jsonData2, 'utf-8')).toString(\"hex\");\n```\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Orders cancelled successfully", "content": { "application/json": { "schema": { "example": [ { "orderId": 43, "pairId": 1, "isCancelled": true, "amount": "1000", "filledAmount": "873", "filledTotal": "9993281000000000000", "averageExecutedPrice": "1000000000000000000" }, { "orderId": 17, "pairId": 1, "isCancelled": false, "reason": "Order has already cancelled or matched" } ] } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" }, "500": { "description": "Internal server error" } }, "tags": [ "Market" ] } }, "/market/open-orders": { "get": { "operationId": "OrderController_", "summary": "Get open orders", "description": "Get open orders related to the wallet address or specifically by the symbol as well. \n#### Order statuses:\n* `1` - Open\n* `2` - Canceled\n* `3` - Matched\n* `4` - Self-matched\n* `5` - Expired\n \n#### Order types:\n* `0` - LIMIT\n* `1` - IOC\n* `2` - POST\n* `3` - MARKET\n \n#### Order sides:\n* `0` - BUY\n* `1` - SELL\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } }, { "name": "symbol", "required": false, "in": "query", "description": "Market symbol, e.g. sol_eth", "examples": { "sol_eth": { "value": "sol_eth" }, "lmbo_algo": { "value": "lmbo_algo" } }, "schema": {} } ], "responses": { "200": { "description": "Open orders retrieved successfully", "content": { "application/json": { "schema": { "example": [ { "id": 2, "pairId": 13, "pair": "algo_usdc", "amount": "10000000", "price": "1000000000000000000", "total": "0", "filledAmount": "2000000", "filledTotal": "0", "avgPrice": "1000000000000000000", "status": 1, "side": 1, "type": 0, "userId": "0x37eAF916551B7DA897244E0f61120B81ad1B8636", "createdAt": 1719499926063, "updatedAt": 1719499926063 } ] } } } }, "400": { "description": "Bad request" } }, "tags": [ "Market" ] } }, "/market/order/message": { "post": { "operationId": "OrderController_", "summary": "Generate message from the order data", "description": "\n\n### Order Message values explanation\n\nThe `random` value must be a number no more than 2 ^ 53 - 1\n\nThe `decimalPrice` is a price in decimal string value in the human readable format\n\nThe `price` is in factored units equals `decimalPrice` * 10 ^ 18\n\nThe `version` is a current order msg version. Current value: 1\n\nThe `companyId` value can be obtained from the request `GET market/settings`\n\nTokens data can be obtained from the request `GET market/markets`\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Order message generated successfully" }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" }, "500": { "description": "Internal server error" } }, "tags": [ "Market" ] } }, "/market/order": { "post": { "operationId": "OrderController_", "summary": "Create new order", "description": "\n\n### Order Message values explanation\n\nThe `random` value must be a number no more than 2 ^ 53 - 1\n\nThe `decimalPrice` is a price in decimal string value in the human readable format\n\nThe `price` is in factored units equals `decimalPrice` * 10 ^ 18\n\nThe `version` is a current order msg version. Current value: 1\n\n### Instructions for Creating an Order Creation Message\n\nTo create a message from multiple arguments, follow these steps:\n\n- Concatenate all arguments in their bytes representation in a specific order.\n- Each argument must have a specific length.\n\n#### Example of Message Creation\n\n```typescript\nconst orderBytes = concatBytes([\n version, // order msg version number 2 bytes\n expirationTime, // expiration time 4 bytes\n orderSide, // order side (\"B\" | \"S\") 1 byte\n price, // price in factored units 32 bytes\n amount, // amount in atomic units 32 bytes\n orderType, // order type (\"L\" | \"I\" | \"P\" | \"M\") 1 byte\n liginAccountAddress, // normalized wallet address 32 bytes\n loginAccountChainId, // chain id (Wormhole chain id) 2 bytes\n baseTokenAddress, // normalized token address 32 bytes\n baseTokenChainId, // base token Wormhole chain id 4 bytes\n priceTokenAddress, // normalized token address taken from market pair 32 bytes\n priceTokenChainId, // price token Wormhole chain id 4 bytes\n companyId, // company id 2 bytes\n randomValue, // random number 8 bytes\n decimalPrice, // human readable price decimal string 8 bytes\n zeroBytes // extra 50 zero bytes\n]);\n\nconst bs64OrderBytes = new ByteArray(orderBytes.toBase64());\n```\n\n### Normalizing Addresses\n\nThe normalized address is a 32-byte hex string converted from the original address. This normalization ensures that addresses from different chains are of a consistent length for codex management and WH message interaction.\n\n#### Examples of Normalized Addresses:\n\n- **EVM Address**:\n - Original: `0xC8b9Cb9D80e8d35486A2bf9e9F8DF793c2d077a0`\n - Normalized: `00000000000000000000000c8b9cb9d80e8d35486a2bf9e9f8df793c2d077a0`\n\n- **Algorand Address**:\n - Original: `EN24BSP6WLG2DI7WOZ45P4A2PHI5RKCGA4ZE4W3C6E3GCWBPOUU4ZCX4D4`\n ```typescript\n algosdk.decodeAddress(address).publicKey\n ```\n - Normalized: `2375c0c9feb2cda1a3f67679d7f01a79d1d8a84607324e5b62f13661582f7529`\n\n- **Solana Address**:\n - Original: `D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW`\n ```typescript\n bs58.decode(address)\n ```\n - Normalized: `b3cafe5d05e60d7452fab7b6300f8b0f16842fa76b1168765bcbd9bbc652003d`\n\n- **Algorand Token ID**:\n - Original: `10458941`\n - Normalized: `0000000000000000000000000000000000000000000000000000000010458941`\n\nBy following these instructions and using the provided example, you can concatenate multiple arguments into a byte array and normalize addresses for consistent handling across different blockchain networks.\n\n**Important Note:** The `orderBytes` must be converted to a base64 string and then the base64 string must be converted back to bytes.\n\n#### Final Step: Convert Final Bytes Result into a Hex String\n\n```typescript\nconst hexOrderBytes = Buffer.from(bs64OrderBytes).toString('hex');\n```\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n### Market Order Rules\n\nWhen creating Market Orders, the interpretation of amount and price (which represents the total in this context) depends on the type of market order and whether the order is a buy or sell order.\n#### BUY MARKET ORDER\n\n**By Amount**:\namount is not zero,\n price (total) is not zero and represents the maximum volume of the quote currency (price coin) you are willing to spend.\n The system calculates the total amount you will receive based on the current market prices.\n\n**By Total**:\namount is zero,\n price (total) is not zero and represents the maximum volume of the quote currency (price coin) you are willing to spend.\n The system calculates the amount of the base currency (amount coin) you will receive for the specified total.\n\n#### SELL MARKET ORDER\n\nBy Amount:\n amount is not zero and represents the quantity of the base currency (amount coin) you want to sell.\n price (total) is zero because in a sell market order, the system will automatically determine the total amount of the quote currency (price coin) you will receive based on current market prices.\n\n#### Summary of Logic:\n\nIn Buy Market Orders, the price field represents the maximum total in quote currency you are willing to spend, and it must be provided.\nIn Sell Market Orders, the amount field represents the quantity you wish to sell, and the system calculates the corresponding total based on the market.\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Order created successfully" }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" }, "500": { "description": "Internal server error" } }, "tags": [ "Market" ] }, "delete": { "operationId": "OrderController_", "summary": "Cancel open order", "description": "\n### Instructions for Creating an Order Cancellation Message\n\nTo create a message from data, follow these steps:\n\n1. *Create JSON string from data*\n2. *Convert JSON string to bytes*\n3. *Convert bytes to hex string*\n\nThis final conversion ensures the message is in a hexadecimal string format, suitable for transmission or storage.\n\n\n#### Example of Message Creation\n```\ntypescript\nconst data = { \"orderId\": 1 };\nconst jsonData = JSON.stringify(data);\nconst message = Buffer.from(Buffer.from(jsonData, 'utf-8')).toString(\"hex\");\n```\n", "parameters": [ { "name": "x-wallet-address", "in": "header", "description": "Login wallet address", "required": true, "schema": { "type": "string" } }, { "name": "x-wallet-token", "in": "header", "description": "Login session token (optional if API key is provided in x-trading-key)", "required": false, "schema": { "type": "string" } }, { "name": "x-trading-key", "in": "header", "description": "Trading key address (optional if x-wallet-token is provided)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Order cancelled successfully", "content": { "application/json": { "schema": { "example": { "orderId": 43, "pairId": 1, "isCancelled": true, "amount": "1000", "filledAmount": "873", "filledTotal": "9993281000000000000", "averageExecutedPrice": "1000000000000000000" } } } } }, "400": { "description": "Bad request" }, "403": { "description": "Forbidden" }, "500": { "description": "Internal server error" } }, "tags": [ "Market" ] } }, "/system/time": { "get": { "operationId": "SystemController_getTime", "summary": "Get current system time", "parameters": [], "responses": { "200": { "description": "Current system time retrieved successfully", "content": { "application/json": { "schema": { "example": { "currentTime": 1719327351644 } } } } } }, "tags": [ "System" ] } }, "/system/maintenance": { "get": { "operationId": "SystemController_getMaintenance", "summary": "Get system maintenance status", "parameters": [], "responses": { "200": { "description": "System maintenance status retrieved successfully", "content": { "application/json": { "schema": { "example": { "mode": 0 } } } } } }, "tags": [ "System" ] } }, "/system/version": { "get": { "operationId": "SystemController_getVersion", "summary": "Get system version", "parameters": [], "responses": { "200": { "description": "System version retrieved successfully", "content": { "application/json": { "schema": { "example": { "version": "1.0.0" } } } } } }, "tags": [ "System" ] } } }, "info": { "title": "Ultrade API Documentation", "description": "\n Welcome to the Ultrade API Documentation.\n \n **Rate Limiting:** \n All endpoints are protected by a rate limit of **250 requests per IP address** within a **5-minute window**. \n If the rate limit is exceeded, further requests from that IP address may be blocked temporarily with a `429 Too Many Requests` response.\n ", "version": "1.0", "contact": {} }, "tags": [], "servers": [], "components": { "schemas": { "WalletDataDto": { "type": "object", "properties": { "address": { "type": "string", "description": "Login wallet address", "example": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW" }, "technology": { "type": "string", "description": "Technology", "example": "SOLANA" } }, "required": [ "address", "technology" ] }, "PostSignInMessageDto": { "type": "object", "properties": { "data": { "description": "Wallet data", "example": { "address": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW", "technology": "SOLANA" }, "allOf": [ { "$ref": "#/components/schemas/WalletDataDto" } ] }, "customMessage": { "type": "string", "description": "Custom signing message", "example": "By signing this message you are logging into your trading account" } }, "required": [ "data" ] }, "PostSignInDto": { "type": "object", "properties": { "message": { "type": "string", "description": "The signed message in hex format", "example": "574954484452415720312055534443732028536f6c616e61204465766e6574290a4665653a20555344437320302e303030303031202824302e3030290a546f6b656e2069643a204768395a77456d644c4a384473634b4e546b547150624e774c4e4e426a75537a6147395670324b47744b4a720a546f204163636f756e743a20443671574e6e44366a73364377626772713752427869515036754c62355768536448536572503753336871570a7338722b5851586d445852532b7265324d412b4c447861454c366472455768325738765a75385a5341443041414141414141414141656b6f4f56554a5a662f55316b724b72306255586663786a6c745056386b4d53483167596c32436d344e377338722b5851586d445852532b7265324d412b4c447861454c366472455768325738765a75385a534144304141414141414141414151414141414141414141414141414141414141414141414141414141414141414141414141414144304a414141414141414141414141414141414141414141414141414141414141414141414141414141414141414142" }, "signature": { "type": "string", "description": "The signature of the message", "example": "E3qKLcR5g54Xb9ojTKzLEjCLHGcrHgisMxu2UziVb1Bo4BxKpRtQ75MhXB42ZCKUi1Ad1suhDB2GLwyG3kV5XMC" }, "data": { "description": "Wallet data", "example": { "address": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW", "technology": "SOLANA" }, "allOf": [ { "$ref": "#/components/schemas/WalletDataDto" } ] }, "referralToken": { "type": "string", "description": "Affiliate referral token" } }, "required": [ "message", "signature", "data" ] }, "PostTradingKeyMessageDto": { "type": "object", "properties": { "tkAddress": { "type": "string", "description": "Trading key algorand address", "example": "3CRQVNKS7O23IY6GTVF65SLARWL5G6BSSEPEPNT5XFWIWLDTYZMQI4X3HM" }, "loginAddress": { "type": "string", "description": "Login wallet address", "example": "0x58952B2f7e14b9F410E90EEdE4474B40e09a4B1b" }, "loginChainId": { "type": "number", "description": "Wormhole chain id", "enum": [ 1, 8, 5, 4, 6, 23, 24, 30, 2, 10002, 10003, 10004, 10005, 10007 ], "example": "5" }, "expiredDate": { "type": "number", "description": "UTC timestamp in seconds; If it's not set then no expiration", "example": "1726680065" }, "addKey": { "type": "boolean", "description": "Add a trading key if the value is true, otherwise revoke" }, "type": { "type": "string", "description": "Type of trading key", "enum": [ "User", "API" ] } }, "required": [ "tkAddress", "loginAddress", "loginChainId", "addKey", "type" ] }, "WithdrawDataDto": { "type": "object", "properties": { "loginAddress": { "type": "string", "description": "Login wallet address", "example": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW" }, "loginChainId": { "type": "number", "description": "Wormhole chain ID", "example": 1 }, "tokenAmount": { "type": "string", "description": "Withdrawal amount in atomic units", "example": "1000000" }, "tokenIndex": { "type": "string", "description": "Withdrawal token address", "example": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr" }, "tokenChainId": { "type": "number", "description": "Token chain ID", "example": 1 }, "recipient": { "type": "string", "description": "Recipient address", "example": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW" }, "recipientChainId": { "type": "number", "description": "Recipient chain ID", "example": 1 }, "isNative": { "type": "boolean", "description": "Is native token", "example": false }, "fee": { "type": "number", "description": "Fee amount", "example": "1" } }, "required": [ "loginAddress", "loginChainId", "tokenAmount", "tokenIndex", "tokenChainId", "recipient", "recipientChainId", "isNative", "fee" ] }, "PostWithdrawMessageDto": { "type": "object", "properties": { "data": { "description": "The withdrawal data to create the signing message", "example": { "loginAddress": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW", "loginChainId": 1, "tokenAmount": "1000000", "tokenIndex": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", "tokenChainId": 1, "recipient": "D6qWNnD6js6Cwbgrq7RBxiQP6uLb5WhSdHSerP7S3hqW", "recipientChainId": 1, "fee": "1", "isNative": false }, "allOf": [ { "$ref": "#/components/schemas/WithdrawDataDto" } ] }, "customMessage": { "type": "string", "description": "The custom message visible to the user", "example": "WITHDRAW 0.0001 STT" } }, "required": [ "data" ] }, "GetPriceResponseDto": { "type": "object", "properties": { "pairId": { "type": "number", "description": "Market id", "example": 46 }, "pair": { "type": "string", "description": "Market symbol", "example": "usdcs_algo" }, "askPrice": { "type": "string", "description": "Ask price in atomic units", "example": "35000" }, "askQty": { "type": "string", "description": "Ask depth in atomic units", "example": "64000000" }, "bidPrice": { "type": "string", "description": "Bid price in atomic units", "example": "29910" }, "bidQty": { "type": "string", "description": "Bid depth in atomic units", "example": "247000000" }, "lastPrice": { "type": "string", "description": "Last price in atomic units", "example": "31230" }, "ts": { "type": "number", "description": "UTC timestamp with microseconds", "example": 1719323536855.245 }, "u": { "type": "number", "description": "The last sequence number of the order book update", "example": 4065 }, "U": { "type": "number", "description": "The prev sequence number of the order book update", "example": 4021 } }, "required": [ "pairId", "pair", "askPrice", "askQty", "bidPrice", "bidQty", "lastPrice", "ts", "u", "U" ] }, "GetDepthResponseDto": { "type": "object", "properties": { "pair": { "type": "string", "description": "Market symbol", "example": "usdcs_algo" }, "buy": { "description": "Order book depth of buy side", "example": [ [ "1000", "1000000" ] ], "type": "array", "items": { "type": "string" } }, "sell": { "description": "Order book depth of sell side", "example": [ [ "7000", "1000000" ] ], "type": "array", "items": { "type": "string" } }, "ts": { "type": "number", "description": "UTC timestamp with microseconds", "example": 1719323536855.245 }, "u": { "type": "number", "description": "The last sequence number of the order book update", "example": 4065 } }, "required": [ "pair", "buy", "sell", "ts", "u" ] }, "GetHistoryResponseDto": { "type": "object", "properties": { "t": { "description": "Timestamps", "example": [ 1702944000, 1705968000, 1707177600, 1708473600, 1709596800, 1710201600, 1710288000, 1710374400, 1716249600, 1716336000, 1716422400, 1716508800, 1719273600 ], "type": "array", "items": { "type": "string" } }, "o": { "description": "Open prices", "example": [ 0.001, 0.001, 0.05, 0.001, 0.044, 0.046, 0.048, 0.049, 0.001, 1, 0.01, 0.019, 0.001 ], "type": "array", "items": { "type": "string" } }, "c": { "description": "Close prices", "example": [ 0.001, 0.013, 0.05, 0.001, 0.045, 0.046, 0.048, 0.049, 0.001, 1, 1, 0.001, 0.006 ], "type": "array", "items": { "type": "string" } }, "l": { "description": "Low prices", "example": [ 0.001, 0.001, 0.05, 0.001, 0.044, 0.046, 0.048, 0.049, 0.001, 1, 0.001, 0.001, 0.001 ], "type": "array", "items": { "type": "string" } }, "h": { "description": "High prices", "example": [ 0.001, 0.17, 0.05, 0.002, 0.045, 0.046, 0.048, 0.049, 0.001, 1, 1, 0.019, 0.2 ], "type": "array", "items": { "type": "string" } }, "v": { "description": "Base coin volumes", "example": [ 1, 28.5, 1, 3.8, 2, 1, 1, 2, 1, 3, 12, 19, 4 ], "type": "array", "items": { "type": "string" } }, "q": { "description": "Quote coin volumes", "example": [ 1, 28.5, 1, 3.8, 2, 1, 1, 2, 1, 3, 12, 19, 4 ], "type": "array", "items": { "type": "string" } }, "s": { "type": "string", "description": "Status", "example": "ok" }, "b": { "type": "number", "description": "Start timestamp of trading history in UTC in ms", "example": 1702989335082 } }, "required": [ "t", "o", "c", "l", "h", "v", "q", "s", "b" ] }, "BalanceResponseDto": { "type": "object", "properties": { "hash": { "type": "string", "description": "Hash of balance", "example": "fa97f507eb158752f28b0f95af10a7cc5ed9c257c2997acb1966993136e4be61" }, "loginAddress": { "type": "string", "description": "Login wallet address", "example": "HjNg63be7HdsydC8NPtXn43FoVHUMD2kcxpfhBx1r8NN" }, "loginChainId": { "type": "number", "description": "Login wallet chain id", "example": 1 }, "tokenId": { "type": "number", "description": "Token id", "example": 1 }, "tokenAddress": { "type": "string", "description": "Token address", "example": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr" }, "tokenChainId": { "type": "number", "description": "Token chain id", "example": 1 }, "amount": { "type": "string", "description": "Amount in atomic units", "example": "18800000" }, "lockedAmount": { "type": "string", "description": "Locked amount in atomic units", "example": "800000" } }, "required": [ "hash", "loginAddress", "loginChainId", "tokenId", "tokenAddress", "tokenChainId", "amount", "lockedAmount" ] }, "GetFeeRatesResponseDto": { "type": "object", "properties": { "takerFee": { "type": "number", "description": "Taker fee", "example": 22 }, "makerFee": { "type": "number", "description": "Maker fee", "example": 20 } }, "required": [ "takerFee", "makerFee" ] }, "GetOrderByIdResponseDto": { "type": "object", "properties": { "id": { "type": "number", "description": "Order id", "example": 2 }, "pairId": { "type": "number", "description": "Pair id", "example": 13 }, "pair": { "type": "string", "description": "Pair symbol", "example": "algo_usdc" }, "status": { "type": "number", "description": "Order status. Values: 1 -> Open, 2 -> Canceled, 3 -> Matched, 4 -> Self-matched, 5 -> Expired", "example": 1 }, "side": { "type": "number", "description": "Order side. Values: 0 -> BUY, 1 -> SELL", "example": 1 }, "type": { "type": "number", "description": "Order type. Values: 0 -> LIMIT, 1 -> IOC, 2 -> POST, 3 -> MARKET", "example": 0 }, "amount": { "type": "string", "description": "Amount in atomic units of base coin", "example": "10000000" }, "price": { "type": "string", "description": "Price in atomic units of price coin", "example": "1000000000000000000" }, "filledAmount": { "type": "string", "description": "Filled order amount in atomic units", "example": "2000000" }, "total": { "type": "string", "description": "Total in atomic units of price coin", "example": "0" }, "filledTotal": { "type": "string", "description": "Filled total in atomic units of price coin", "example": "0" }, "avgPrice": { "type": "string", "description": "Average execution price", "example": "1000000000000000000" }, "userId": { "type": "string", "description": "Login wallet address", "example": "0x37eAF916551B7DA897244E0f61120B81ad1B8636" }, "createdAt": { "type": "number", "description": "Order creation time", "example": 1719499926063 }, "completedAt": { "type": "number", "description": "Order completion time", "example": null }, "updatedAt": { "type": "number", "description": "Order update time", "example": 1719499926063 }, "trades": { "description": "", "example": [ { "tradeId": 1, "tradeSide": 0, "amount": "1000000", "price": "1000000", "fee": "0", "createdAt": 1719499962401, "updatedAt": 1719499963000, "isBuyer": false, "isMaker": true }, { "tradeId": 2, "tradeSide": 0, "amount": "1000000", "price": "1000000", "fee": "1000", "createdAt": 1719499966665, "updatedAt": 1719499967000, "isBuyer": false, "isMaker": false } ], "type": "array", "items": { "type": "string" } } }, "required": [ "id", "pairId", "pair", "status", "side", "type", "amount", "price", "filledAmount", "total", "filledTotal", "avgPrice", "userId", "createdAt" ] }, "SuccessOrderDto": { "type": "object", "properties": { "orderId": { "type": "number", "description": "Order id", "example": 2 }, "pairId": { "type": "number", "description": "Pair id", "example": 13 }, "pair": { "type": "string", "description": "Pair symbol", "example": "algo_usdc" } }, "required": [ "orderId", "pairId", "pair" ] }, "FailedOrderDto": { "type": "object", "properties": { "reason": { "type": "string", "description": "Fail reason", "example": "Insufficient balance to lock" } }, "required": [ "reason" ] }, "CreateOrdersDto": { "type": "object", "properties": { "successfulOrders": { "description": "List of successfully created orders", "example": [ { "orderData": { "expiredDate": "2024-11-19T13:25:21.000Z", "baseTokenAddress": "0", "baseTokenChainId": 8, "priceTokenAddress": "0x4343545055534443000000000000000000000000000000000000000000000000", "priceTokenChainId": 65537, "companyId": 1, "address": "0xe56310178b0bfe0f49877fcb701e208fed89d337", "chainId": 5, "orderSide": "B", "orderType": "L", "price": "900000000000000000", "amount": "100000", "expiredTime": 1732022721, "random": 9007199254740991 }, "orderId": 12342634, "pairId": 1, "pair": "algo_usdc" } ], "type": "array", "items": { "$ref": "#/components/schemas/SuccessOrderDto" } }, "failedOrders": { "description": "List of orders that failed to be created", "example": [ { "orderData": { "expiredDate": "2024-11-19T13:25:21.000Z", "baseTokenAddress": "0", "baseTokenChainId": 8, "priceTokenAddress": "0x4343545055534443000000000000000000000000000000000000000000000000", "priceTokenChainId": 65537, "companyId": 1, "address": "0xe56310178b0bfe0f49877fcb701e208fed89d337", "chainId": 5, "orderSide": "B", "orderType": "L", "price": "900000000000000000", "amount": "100000", "expiredTime": 1732022721, "random": 9007199254740991 }, "reason": "Insufficient balance to lock" } ], "type": "array", "items": { "$ref": "#/components/schemas/FailedOrderDto" } } }, "required": [ "successfulOrders", "failedOrders" ] } } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GoPlausible/algorand-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server